﻿function divShow(MsgInfo)
{
    document.getElementById('divMessage').innerHTML = MsgInfo;
    document.getElementById('divMsg').style.display = "block";
    var yScrolltop;
    var xScrollleft;
    if (self.pageYOffset || self.pageXOffset) {
        yScrolltop = self.pageYOffset;
        xScrollleft = self.pageXOffset;
    } else if (document.documentElement && document.documentElement.scrollTop || document.documentElement.scrollLeft ){     // Explorer 6 Strict
        yScrolltop = document.documentElement.scrollTop;
        xScrollleft = document.documentElement.scrollLeft;
    } else if (document.body) {// all other Explorers
        yScrolltop = document.body.scrollTop;
        xScrollleft = document.body.scrollLeft;
    }            
    
    yScrolltop = yScrolltop + event.clientY;
    xScrollleft = xScrollleft + event.clientX;
    //scrollHeight
    //offsetHeight
    var divMsgHeight = document.getElementById('divMsg').scrollHeight;
    if(divMsgHeight < yScrolltop)
    {
        yScrolltop = yScrolltop - divMsgHeight;
    }
    
    document.getElementById('divMsg').style.top = yScrolltop;
    document.getElementById('divMsg').style.left = xScrollleft + 5;
}
function divHide()
{
    document.getElementById('divMsg').style.display = "none";
}